package main

import (
	"fmt"
	"math"
)

func switchFunc(name string, number int) {
	switch {
	case number >= 90:
		fmt.Println(name + "; 成绩优秀")
	case number >= 80:
		fmt.Println(name + "; 成绩良好")
	case number >= 70:
		fmt.Println(name + "; 成绩中等")
	default:
		fmt.Println(name + "; 成绩及格")
	}
}

func swichFuncInt(x interface{}) int {
	switch t := x.(type) {
	case int:
		return t
	case float64:
		return int(math.Ceil(t))
	}
	return 0
}

/* 学习链接*/
/* https://golang-minibear2333.github.io/1.base/1-5-switch%E5%92%8Ctypeswitch/ */
func main() {
	switchFunc("陈明", 90)
	fmt.Println(swichFuncInt(10))
}
